package hashfunctions;

import java.util.BitSet;

public class HashBobNervio_128 extends HashFunction_128 {

	@Override
	public String hash(String clearTextPassword){
		return Hash.bitSetToString(hashBitSet(clearTextPassword));
	}
	
	public BitSet hashBitSet(String palabra) {
		BitSet output=new BitSet(128);
		output.set(Math.abs(palabra.hashCode()*palabra.hashCode()-palabra.length())%128);
		output.set((palabra.length()*palabra.length()*palabra.length()*palabra.length())%128);
		output.set(Math.abs((palabra.hashCode())%128));
		output.set((int)Math.pow(palabra.charAt(0),palabra.length())%128);
		
		return output;
	}

	public String tipo() {
		return "BobNervio";
	}
}
